
fn main() {
    println!("Hello, world!");
    let context = get_context("http://www.baidu.com");
    println!("{}", context);
}

fn get_context(url:&str) -> String {
    let future = http_get(url);
    let context = futures::executor::block_on(future);
    let context = context.unwrap();
    context
}

async fn http_get(url:&str) -> Result<String, Box<dyn std::error::Error>> {
    let res = surf::get(url).recv_string().await;
    Ok(res?)
}


